:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --light-bg: #f8f9fa;
    --dark-text: #2b2d42;
    --light-text: #adb5bd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-text);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 30px;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.app-header h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.app-header .team-name {
    color: var(--light-text);
    font-size: 1rem;
}

/* 控制面板样式 */
.control-panel {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.member-filter {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-title {
    margin-right: 15px;
    font-weight: 600;
    color: var(--dark-text);
}

.member-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.member-tag {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    background: #e9ecef;
    color: var(--dark-text);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.member-tag.active {
    background: var(--member-color, var(--primary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.member-tag:hover:not(.active) {
    background: #dee2e6;
}

.action-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.add-item {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-item input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.add-item select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    min-width: 120px;
}

.add-item button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-item button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 统计卡片 */
.stats-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-value.pending {
    color: var(--danger-color);
}

.stat-value.purchased {
    color: var(--success-color);
}

.stat-label {
    color: var(--light-text);
    font-size: 0.9rem;
}

/* 购物清单容器 */
.shopping-list-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.list-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

#itemsList {
    max-height: 500px;
    overflow-y: auto;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--light-text);
}

.empty-state img {
    width: 120px;
    height: 120px;
    opacity: 0.6;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--dark-text);
}

.item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
    transition: all 0.3s;
}

.item:last-child {
    border-bottom: none;
}

.item:hover {
    background: #f8f9fa;
}

.item-name {
    font-weight: 500;
    word-break: break-word;
}

.item.purchased .item-name {
    text-decoration: line-through;
    color: var(--light-text);
}

.member-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    text-align: center;
    color: white;
    display: inline-block;
    min-width: 60px;
    background: var(--member-color);
}

.status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    font-weight: 500;
}

.status.pending {
    background: #fff3bf;
    color: #f08c00;
}

.status.purchased {
    background: #d3f9d8;
    color: #2b8a3e;
}

.status i {
    margin-right: 5px;
}

.delete-btn {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.delete-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* 协作指南 */
.collab-guide {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
}

.collab-guide h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collab-guide ul {
    list-style: none;
}

.collab-guide li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark-text);
}

.collab-guide i {
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }

    .list-header, .item {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .action-bar {
        flex-direction: column;
    }

    .add-item input,
    .add-item select,
    .add-item button {
        width: 100%;
    }

    .stats-card {
        grid-template-columns: 1fr;
    }

    .member-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-title {
        margin-bottom: 10px;
    }
}
